package com.itheima07;

public class ZiDinYiYiChang {
    public static void main(String[] args) {
        int score = 210;
        try {
            function(score);
        } catch (HightException e) {
            e.printStackTrace();
        } catch (LowException e) {
            e.printStackTrace();
        }
        System.out.println("程序执行完毕");
    }

    //定义一个方法，去接受考试成绩
    public static void function(int score) throws HightException, LowException {
        //判断成绩的范围
        if (score > 100) {
            throw new HightException("你的老师真爱你");
        }
        if (score < 0) {
            throw new LowException("您的老师真恨你");
        }
        //显示成绩符合要求
        System.out.println("考试成绩符合要求");
    }
}
